package com.yz.antlr.VisitorDemo;

/**
 * @author yanzhao
 * @version 1.0
 * TODO
 * @date 2022/4/2 18:01
 */
public class ItemVisitor implements Visitor {

    @Override
    public void visit(Element e) {

        if (e instanceof Item) {
            Item item = (Item) e;
            System.out.println("[商品名=" + item.getName() + ", 价格=" + item.getPrice() + "]");
        }
    }

}